package com.ouc.entity;

import lombok.Data;

/**
 * @Name: ShoppingCar
 * @Description: 购物车Item
 * @Author: Mr.Tong
 */
@Data
public class CartItem {
    //id属性
    private Integer id;
    //总费用=所有数量产品的成本费用+所有数量产品的加工费用
    private Double totalCost;
    //产品数量
    private Integer quantity;
    //产品编码
    private String frameCode;
    //用户Id
    private Integer userId;


    private Frame frame;
    private User owner;

    public Double getTotalCost() {
        return frame.getUnitPrice() * quantity;
    }


    public void addQuantity(Integer newQuantity) {
        this.quantity += newQuantity;
    }
//
//    public void addTotalCost(Double newTotalCost) {
//        this.totalCost += newTotalCost;
//    }
}
